<?php
ini_set("error_reporting","E_ALL & ~E_NOTICE");
	$i=($_GET['money']);
	if($i=="10" || $i=="50" || $i=="100" || $i=="200" || $i=="500" || $i=="1000"){
		$qr=$i;
	}else{
		$qr=x;
	}
	$oid=($_GET['orderId']);
	$type=($_GET['payMode']);
	$money=$i;
	if($type=="30001"){$type=1;}
	if($type=="40001"){$type=2;}
	if($type=="50001"){$type=3;}
	if($type==1){$name="支付宝";$dir="zfb";$logo="../images/pay/ali.png";$app="https://mobile.alipay.com/index.htm";}
	if($type==2){$name="微信";$dir="wx";$logo="../images/pay/wx.png";$app="https://weixin.qq.com/";}
	if($type==3){$name="QQ";$dir="qq";$logo="../images/pay/qq.png";$app="https://im.qq.com/mobileqq/";}
	$ewm=$dir."/".$qr.".png";
?>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8" />
	<title><?php echo $name;?>扫码支付</title>
	<style type="text/css">
.btn{
	color: #606060;
    border: solid 1px #b7b7b7;
    background: #fff;
    background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
    background: -moz-linear-gradient(top, #fff, #ededed);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
    display: inline-block;
    zoom: 1;
    vertical-align: baseline;
    margin: 0 2px;
    outline: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font: 12px/100% Arial, Helvetica, sans-serif;
    padding: .5em 1em .55em;
    text-shadow: 0 1px 1px rgba(0,0,0,.3);
    -webkit-border-radius: .5em;
    -moz-border-radius: .5em;
    border-radius: .5em;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
    -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.btn:hover {
	text-decoration: none;
	background: #ededed;
	background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
	background: -moz-linear-gradient(top,  #fff,  #dcdcdc);
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
}
.btn:active {
	color: #999;
	background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
	background: -moz-linear-gradient(top,  #ededed,  #fff);
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
}
	</style>

</head>
<body style="background-color: #EFF0F1;text-align:center;margin:60px auto 20px;" onload="closeWindow();">
	<div class="paytop" style="width:400px;margin:auto;"><img src="<?php echo $logo;?>" width="99" height="66" border="0"></div>
	<div class="paybox" style="background-color: #FFF;width:400px;margin:10px auto;padding:20px;border:3px solid #B3B3B3;border-left-width:1px;border-right-width:1px;">
		<p style="font:12px/1.5 tahoma,arial;margin:10px 0;">扫一扫付款（元）</p>
		<p style="font-size: 26px;font-weight: 700;color: #f60;margin:10px 0;"><?php echo $money;?></p>
		<div class="payewmbox" style="width:168px;height:auto;min-height:168px;margin:0 auto;padding:6px;border:1px solid #d3d3d3;-webkit-box-shadow: 1px 1px 1px #ccc;box-shadow: 1px 1px 1px #ccc;">
			<img class="payewmimg" src="<?php echo $ewm;?>" width="168" height="168" border="0">
			<div class="payewmbottom">
				<img style="float:left;margin-left:20px;margin-top:4px;display: inline;" src="/pay/sao.png">
				<div style="float:left;margin-left:10px;display:inline;font: 12px/1.5 tahoma,arial;color:#4D4D4D;">打开手机<?php echo $name;?><br><?php if($qr=x){echo '<font color=#f60>输入金额后付款</font>';}else{echo '扫一扫继续付款';}?></div>
			</div>
			<div style="clear:both;"></div>
		</div>
		<p><a style="font-size:12px;color: #a6a6a6;text-decoration: underline;" href="<?php echo $app;?></p>" target="_blank">首次使用请下载手机<?php echo $name;?>App</a></p>
		<p id="timeout" style="font-size:12px;color:#a6a6a6;">请在120秒内完成支付，超时将关闭</p>
		<form action="send.php" method="post">
			<input type="hidden" name="type" value="<?php echo $type;?>">
			<input type="hidden" name="money" value="<?php echo $money;?>">
			<input type="hidden" name="oid" value="<?php echo $oid;?>">
			<input class="btn" type="submit" name="close" value="付款后点击完成"/>
		</form>
	</div>
	<script type="text/javascript">
		var time=120;  
		function closeWindow(){  
			window.setTimeout('closeWindow()',1000);  
			if(time>0){  
				document.getElementById("timeout").innerHTML="请在<font color=red>"+time+"</font>秒内完成支付，超时将关闭";  
				time--;  
			}  
			else{  
				window.opener=null; 
				window.close();  
			}  
		}  
	</script>
</body>
</html>